package com.spic.business.train.examination.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.spic.business.train.createtest.domain.TrainExam;
import com.spic.business.train.createtest.mapper.TrainExamMapper;
import com.spic.business.train.createtest.service.ITrainExamService;
import com.spic.business.train.examination.domain.TrainPaper;

import com.spic.business.train.examination.mapper.TrainPaperMapper;

import com.spic.business.train.examination.service.ITrainPaperService;
import com.spic.business.train.questions.domain.TrainQuestions;
import com.spic.business.train.questions.mapper.TrainQuestionsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * 试卷Service业务层处理
 *
 * @author qishaoping
 * @date 2021-10-21
 */
@Service
public class TrainPaperServiceImpl extends ServiceImpl<TrainPaperMapper,TrainPaper> implements ITrainPaperService {
    @Autowired
    private TrainPaperMapper trainPaperMapper;
    @Autowired
    private TrainExamMapper trainExamMapper;

    @Autowired
    private ITrainExamService trainExamService;
    @Autowired
    private TrainQuestionsMapper trainQuestionsMapper;


    /**
     * 查询试卷
     *
     * @param id 试卷主键
     * @return 试卷
     */
    @Override
    public TrainPaper selectTrainPaperById(Long id) {
        return trainPaperMapper.selectTrainPaperById(id);
    }

    /**
     * 查询试卷列表
     *
     * @param trainPaper 试卷
     * @return 试卷
     */
    @Override
    public List<TrainPaper> selectTrainPaperList(TrainPaper trainPaper) {
        return trainPaperMapper.selectTrainPaperList(trainPaper);
    }

    /**
     * 新增试卷
     *
     * @param trainPaper 试卷
     * @return 结果
     */
    @Override
    public int insertTrainPaper(TrainPaper trainPaper) {
        return trainPaperMapper.insertTrainPaper(trainPaper);
    }

    /**
     * 修改试卷
     *
     * @param trainPaper 试卷
     * @return 结果
     */
    @Override
    public int updateTrainPaper(TrainPaper trainPaper) {
        return trainPaperMapper.updateTrainPaper(trainPaper);
    }

    /**
     * 批量删除试卷
     *
     * @param ids 需要删除的试卷主键
     * @return 结果
     */
    @Override
    public int deleteTrainPaperByIds(Long[] ids) {
        return trainPaperMapper.deleteTrainPaperByIds(ids);
    }

    /**
     * 删除试卷信息
     *
     * @param id 试卷主键
     * @return 结果
     */
    @Override
    public int deleteTrainPaperById(Long id) {
        return trainPaperMapper.deleteTrainPaperById(id);
    }


}
